home *** CD-ROM | disk | FTP | other *** search
Wrap
' '**************************************************************************** ' All code and files Copyright (c) 1994, 1995 Gregory H. Bragg ' Phone: (416) 399-0995 ' Fax: (416) 497-3397 ' Compuserve: 75027,2674 ' Internet: 75027.2674@compuserve.com ' Written: September 23, 1995 ' Revised: October 7, 1995 ' '**************************************************************************** ' Option Explicit ' API function to read WIN.INI to get the name, port type and port number ' of the default printer... Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer) As Integer ' '**************************************************************************** ' ' Function wrapper for Windows API function GetProfileString() ' This procedure will be used for reading WIN.INI ' Revised: September 23, 1995 ' '**************************************************************************** ' Function GetIniProfileString (Section As String, Entry As String, default As String) As String Dim nChars As Integer Dim nBuffLen As Integer Dim mzBuff As String 'keep making the buffer bigger until it is big enough... Do nBuffLen = nBuffLen + 256 mzBuff = Space(nBuffLen) nChars = GetProfileString(Section, ByVal Entry, ByVal default, mzBuff, nBuffLen) 'nChars holds nBuffLen - 2 if buffer too small Loop Until nChars <> nBuffLen - 2 If nChars > 0 Then GetIniProfileString$ = Left(mzBuff, nChars) Else GetIniProfileString$ = "" End If End Function